package starkuz.smartpages.model;

import java.util.Date;

/**
 * Работа на проекте (крепится на страницу или тег)
 */
public class Job implements Comparable {

    //Статусы:
    public final static String STARTING = "starting";
    public final static String INPROGRESS = "inprogress";
    public final static String COMPLETE = "complete";

    private Long id;
    private String name;
    private Long projectOwnerId;
    private Long jobImplementatorId;
    private String status;
    private Date startDate;
    private Date endDate;
    private Date deadLine;
    private Float cost;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getProjectOwnerId() {
        return projectOwnerId;
    }

    public void setProjectOwnerId(Long projectOwnerId) {
        this.projectOwnerId = projectOwnerId;
    }

    public Long getJobImplementatorId() {
        return jobImplementatorId;
    }

    public void setJobImplementatorId(Long jobImplementatorId) {
        this.jobImplementatorId = jobImplementatorId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getDeadLine() {
        return deadLine;
    }

    public void setDeadLine(Date deadLine) {
        this.deadLine = deadLine;
    }

    public Float getCost() {
        return cost;
    }

    public void setCost(Float cost) {
        this.cost = cost;
    }

    //работы отличаются друг от друга айдишниками
    public boolean equals(Object obj) {
        Job job = (Job)obj;
        if (id==job.getId()) {
            return true;
        }
        return false;
    }

    //работы отличаются друг от друга айдишниками
    @Override
    public int compareTo(Object o) {
        Job job = (Job)o;
        return id.compareTo(job.getId());
    }

}
